
#ifndef __3D_VECTOR_H


#define __3D_VECTOR_H


#include "head.h"


class dvector;


class VECTOR {


public:


    double vect_x;


    double vect_y;


    double vect_z;


    VECTOR();


    VECTOR(double x, double y, double z);
    //   VECTOR operator=(const VECTOR &b);


    VECTOR operator+(const VECTOR& b);


    VECTOR operator-(const VECTOR& b);


    VECTOR operator-();


    double operator*(const VECTOR& b);


    friend VECTOR operator*(const double& a, const VECTOR& b);


    friend double amp_R(VECTOR& r_, VECTOR& r1_);


    VECTOR operator=(const dvector& b);


    VECTOR operator*(const double& b);


    VECTOR operator/(const double& b);


    VECTOR operator^(const VECTOR& b);


    void print();


    double abs_vector();


};

class dvector {


public:


    double vect_x;


    double vect_y;


    double vect_z;


    dvector();


    dvector(double x, double y, double z);

    dvector operator+(const dvector& b);

    dvector operator-(const dvector& b);

    dvector operator-();

    double operator*(const dvector& b);

    friend dvector operator*(const double& a, const dvector& b);

    friend double amp_R(dvector& r_, dvector& r1_);

    inline dvector operator=(const VECTOR& b) {

        vect_x = b.vect_x;

        vect_y = b.vect_y;

        vect_z = b.vect_z;

        return *this;

    }

    dvector operator*(const double& b);

    dvector operator/(const double& b);

    dvector operator^(const dvector& b);


    void print();


    double abs_vector();

    dvector(VECTOR& a) {

        vect_x = a.vect_x;

        vect_y = a.vect_y;

        vect_z = a.vect_z;

    }


};


class cvector {


public:


    Complex vect_x;


    Complex vect_y;


    Complex vect_z;


    cvector();


    cvector(Complex x, Complex y, Complex z);


    cvector operator+(const cvector& b);


    cvector operator-(const cvector& b);


    cvector operator-();


    Complex operator*(const cvector& b);


    cvector operator*(const Complex& b);


    cvector operator/(const Complex& b);


    friend cvector operator*(const VECTOR& a, const Complex& b);


    friend cvector operator*(const Complex& b, const VECTOR& a);


    friend cvector operator*(const Complex& b, const cvector& a);


    friend Complex operator*(const cvector& a, const VECTOR& b);


    friend Complex operator*(const VECTOR& a, const cvector& b);


    friend cvector operator-(const cvector& a, const VECTOR& b);


    friend cvector operator-(const VECTOR& a, const cvector& b);


    friend cvector operator+(const cvector& a, const VECTOR& b);


    friend cvector operator+(const cvector& a, const cvector& b);


    /*friend cvector operator/(const cvector &a,const Complex &b);


    friend cvector operator/(const cvector &a,const double &b);


    friend cvector operator*(const cvector &a,const Complex &b);


    friend cvector operator*(const cvector &a,const double &b);


    friend cvector operator*(const Complex &b,const cvector &a);


    friend cvector operator*(const double &b,const cvector &a);*/


    cvector operator^(const cvector& b);


    cvector operator^(const VECTOR& b);


    void print();


    friend cvector conjugate(const cvector& a);


    friend VECTOR real(cvector& a);


    friend VECTOR imag(cvector& a);


    double abs_cvector();

    cvector(VECTOR& a) {
        vect_x = Complex(a.vect_x);
        vect_y = Complex(a.vect_y);
        vect_z = Complex(a.vect_z);
    }

};


#endif